Problem You are given two strings, coordinate1 and coordinate2, representing the coordinates of a square on an 8 x 8 chessboard. Below is the chessboard for reference. Return true if these two…
Connect
Featured posts
Want to read before you subscribe?
Problem You are given an integer array nums, an integer k, and an integer multiplier. You need to perform k operations on nums. In each operation: Find theĀ minimumĀ valueĀ xĀ inĀ nums. If there are…
Problem ou are given a n x n 2D array grid containing distinct elements in the range . Implement the NeighborSum class: NeighborSum(int grid)Ā initializes the object. int adjacentSum(int value)Ā returns theĀ sumĀ of elements which are adjacent…
Problem You are given a string s and an integer k. Encrypt the string using the following algorithm: For each characterĀ cĀ inĀ s, replaceĀ cĀ with theĀ kthĀ character afterĀ cĀ in the string (in a…
Problem You are given a binary string s and an integer k. A binary string satisfies the k-constraint if either of the following conditions holds: The number ofĀ 0’s in the string is at mostĀ k. The number…
Problem There is a snake in an n x n matrix grid and can move in four possible directions. Each cell in the grid is identified by the position: grid = (i *…