Lets Code Everyday - Day 30Question - 30: Find All Duplicates in an Array Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, return an array of all the integers that appears twice. Example 1: I...Jun 20, 2023·7 min read
Lets Code Everyday - Day 25Question - 25: Valid Anagram Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters...Apr 30, 2023·6 min read
Lets Code Everyday - Day 24Question - 24: Bulb Switcher There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off if it's on). For the i...Apr 27, 2023·6 min read
Lets Code Everyday - Day 23Question - 23: Move Zeroes Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0] Example 2: Input: nums = [0] Output: [0] ...Apr 25, 2023·3 min read
Lets Code Everyday - Day 22Question - 22: First Missing Positive Given an unsorted integer array nums, return the smallest missing positive integer. Example 1: Input: nums = [1,2,0] Output: 3 Explanation: The numbers in the range [1,2] are all in the array. Example 2: Input: ...Apr 23, 2023·5 min read
Lets Code Everyday - Day 21Hello there 👋, enthusiasts. I wanted to share with others what I had learned from my mistake, which is that it is more necessary to understand the question and the restrictions offered rather than attempting to immediately answer the problem by simp...Apr 21, 2023·5 min read
Lets Code Everyday - Day 20Question - 20: Search Insert Position Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. Example 1: Input: nums = [1,3,5,6], ...Apr 19, 2023·5 min read