Leetcode
Showcasing my solutions to Leetcode problems in Go alongside my thought process and approach to solving them.
287. Find the Duplicate Number
Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive.
424. Longest Repeating Character Replacement
You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times.
141. Linked List Cycle
Given head, the head of a linked list, determine if the linked list has a cycle in it.
21. Merge Two Sorted Lists
You are given the heads of two sorted linked lists list1 and list2.
3. Longest Substring Without Repeating Characters
Given a string s, find the length of the longest substring without duplicate characters.
153. Find Minimum in Rotated Sorted Array
Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:
875. Koko Eating Bananas
Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.
22. Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
128. Longest Consecutive Sequence
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.
49. Group Anagrams
Given an array of strings strs, group the anagrams together. You can return the answer in any order.