Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1.
s
-1
Example 1:
Input: s = "leetcode"Output: 0
Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well.
x
You must not use any built-in exponent function or operator.
pow(x, 0.5)
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.
nums
You must write an algorithm that runs in O(n) time.
O(n)
Input: nums =…