Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.
Write an algorithm to determine if a number n is happy. Return true if n is a happy number, and false if not.
Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i – j) <= k.
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
Given a string s, find the length of the longest substring without repeating characters.
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice.