Feb 24How to Study Leecode with ChatGPT?If you prefer the video version: At this point, unless you’ve been living in a cave, chances are you have probably heard of ChatGPT. Many people have attempted to feed Leetcode coding problems into ChatGPT and ask for a solution. From my experience, it’s been a hit-and-miss depending on…ChatGPT3 min readChatGPT3 min read
Feb 232101. Detonate the Maximum BombsYou are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in the shape of a circle with the center as the location of the bomb. The bombs are represented by a 0-indexed 2D integer…Leetcode4 min readLeetcode4 min read
Feb 222031. Count Subarrays With More Ones Than ZerosYou are given a binary array nums containing only the integers 0 and 1. Return the number of subarrays in nums that have more 1's than 0's. Since the answer may be very large, return it modulo 109 + 7. A subarray is a contiguous sequence of elements within an…Leetcode5 min readLeetcode5 min read
Jan 31LeetCode 1207. Unique Number of OccurrencesGiven an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise. Example 1: Input: arr = [1,2,2,1,1,3] Output: true Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. …Leetcode2 min readLeetcode2 min read
Jan 31LeetCode 1010. Pairs of Songs With Total Durations Divisible by 60You are given a list of songs where the ith song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in seconds is divisible by 60. …Leetcode3 min readLeetcode3 min read
Jan 30LeetCode 869. Reordered Power of 2If you prefer a quick walk through: You are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero. Return true if and only if we can do this so that the resulting number is a…Leetcode3 min readLeetcode3 min read
Jan 27LeetCode 1404. Number of Steps to Reduce a Number in Binary Representation to OneIf you prefer a quick walk through: Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules: If the current number is even, you have to divide it by 2. If the current number…Leetcode5 min readLeetcode5 min read
Jan 24LeetCode 1218. Longest Arithmetic Subsequence of Given Difference SolutionGiven an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that the difference between adjacent elements in the subsequence equals difference. A subsequence is a sequence that can be derived from arr by deleting some or…Leetcode4 min readLeetcode4 min read
Jan 10LeetCode 959. Regions Cut By SlashesIf you prefer a video walk through: An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a '/', '\', or blank space ' '. These characters divide the square into contiguous regions. Given the grid grid represented as…Leetcode5 min readLeetcode5 min read
Dec 21, 2022LeetCode solutionsLeetCode Permutations II LeetCode Shortest Path in Binary Matrix LeetCode Satisfiability of Equality Equations LeetCode Find All Possible Recipes From Given Supplies LeetCode Minesweeper LeetCode Snapshot Array LeetCode Another problem LeetCode Restore IP Addresses LeetCode Kth Missing Positive Number LeetCode Akuna OA #1 — Max Sum Subarray with Length <=…Leetcode1 min readLeetcode1 min read