All Posts

Leetcode 966: Vowel Spellchecker

Design a spellchecker that corrects a given word from a query based on specific rules. For each query, find a matching word from the given wordlist by applying exact matches, case-insensitive matches, or vowel error corrections. Return the corrected word, or an empty string if no match is found.

Leetcode 969: Pancake Sorting

You are tasked with sorting an array of integers by performing a series of pancake flips. A pancake flip involves reversing the order of elements from the start of the array up to a specified index. The goal is to determine the sequence of flips needed to sort the array in ascending order.

Leetcode 973: K Closest Points to Origin

Given an array of points on a 2D plane, find the k closest points to the origin (0, 0) based on Euclidean distance. If multiple points have the same distance, any order is acceptable.

Leetcode 974: Subarray Sums Divisible by K

Given an integer array nums and an integer k, return the number of non-empty subarrays where the sum of elements is divisible by k. A subarray is defined as a contiguous sequence of elements in the array.

Leetcode 977: Squares of a Sorted Array

Given an integer array nums sorted in non-decreasing order, return an array of the squares of each element, sorted in non-decreasing order.

Leetcode 978: Longest Turbulent Subarray

Given an integer array arr, return the length of the largest subarray that is turbulent. A subarray is considered turbulent if the comparison sign alternates between each adjacent pair of elements.