Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vineetagarwal-code/100xdev-assignments
https://github.com/vineetagarwal-code/100xdev-assignments
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vineetagarwal-code/100xdev-assignments
- Owner: VineeTagarwaL-code
- Created: 2024-06-15T07:15:23.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-15T08:06:44.000Z (7 months ago)
- Last Synced: 2024-11-21T11:36:48.520Z (2 months ago)
- Language: Java
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hashing - DSA Questions
## Question 1: Find the First Non-Repeating Character in a String
### Problem Statement:
Given a string `s`, find the first non-repeating character in it and return its index. If it does not exist, return `-1`.### Instructions:
1. The function should be named `firstNonRepeatingCharacter`.
2. The function should take a single parameter:
- `s` (a string, 1 ≤ length(s) ≤ 10^5)
3. Return an integer representing the index of the first non-repeating character.### Example:
```
# Example 1:
s = "leetcode"# Example 2:
s = "loveleetcode"
# Expected output: 2 (The first non-repeating character is 'v' at index 2)# Example 3:
s = "aabb"
# Expected output: -1 (There are no non-repeating characters)
```
## Question 2: Check if Two Strings are Anagrams### Problem Statement:
Given two strings `s` and `t`, write a function to determine if `t` is an anagram of `s`.### Instructions:
1. The function should be named `Anagram`.
2. The function takes double parameter:
- `s` (a string, 1 ≤ length(s) ≤ 10^5)
- `t` (a string, 1 ≤ length(t) ≤ 10^5)
3. Return `True` if t is an anagram of s, and `False` otherwise.### Example:
```# Example 1:
s = "anagram"
t = "nagaram"
# Expected output: True (Both strings are anagrams)# Example 2:
s = "rat"
t = "car"```