leetcode
Leetcode - Gas Station
Leetcode - Gas Station
2024.03.02Problem There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from the ith station to its next (i + 1)th station. You begin the journey with an empty tank at one of the gas stations. Given two integer arrays gas and cost, return the starting gas station's index if you ..
Leetcode86. partition list (kotlin)
Leetcode86. partition list (kotlin)
2023.04.22https://leetcode.com/problems/partition-list/ Partition List - LeetCode Can you solve this real interview question? Partition List - Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the no leetcode.com Given the head of a linked list and a value x, partition..
Leetcode79. Word Search (w. kotlin)
Leetcode79. Word Search (w. kotlin)
2023.04.16Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once. Example 1: val board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]] val word = "SEE" Output: true..