First Unique Character in a String - Leet Code Solution
Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1.
Technical essays, architectural deep-dives, and practical guides at the intersection of code and design.
Page 16 of 30
Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1.
Write a function that reverses a string. The input string is given as an array of characters char[].
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated.
Given a non-empty array of digits representing a non-negative integer, increment one to the integer.
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.
Given a non-empty array of integers, every element appears twice except for one. Find that single one.
LeetCode "Intersection of Two Arrays II" solved with a HashMap frequency count, with full Java code, walkthrough, and time/space complexity analysis.
Given an array of integers, find if the array contains any duplicates.
Given an array of integers nums, find the maximum length of a subarray where the product of all its elements is positive.
Given an array, rotate the array to the right by k steps, where k is non-negative.
Given an array of price of stocks, find maximum profit by buying and selling stock multiple times.