Category Archives: Без рубрики

Algo.Java.DayOfTheYear

// https://leetcode.com/problems/day-of-the-year/description/

Posted in Без рубрики | Leave a comment

Algo.Java.Number of Days Between Two Dates

// https://leetcode.com/problems/number-of-days-between-two-dates/description/

Posted in Без рубрики | Leave a comment

Algo.Java.GCDandLCM

GCD is greatest common divisor // naive approach // more elegant way // least common multiple

Posted in Без рубрики | Leave a comment

Algo.Java.ConvertBinaryToInt.Theory

To convert a binary number to an integer mathematically, you can use the following formula: Formula Given a binary number bbb with digits bk,bk−1,…,b1,b0b_k, b_{k-1}, …, b_1, b_0bk​,bk−1​,…,b1​,b0​, where bib_ibi​ is the bit at position iii (0 for least significant … Continue reading

Posted in Без рубрики | Leave a comment

Algo.Java.prefixesDivBy5

// https://leetcode.com/problems/binary-prefix-divisible-by-5/description/ Also Binary Input as Array If the binary is given as an array of integers (e.g., [1, 0, 1, 1]):

Posted in Без рубрики | Leave a comment

Algo.Java.ShiftArray.ClosestTargetInCircularArray

// https://leetcode.com/problems/shortest-distance-to-target-string-in-a-circular-array/

Posted in Без рубрики | Leave a comment

Algo.Java.ShiftArray

// right // left // left // right

Posted in Без рубрики | Leave a comment

Algo.Java.PowerOfTreeSet

// https://leetcode.com/problems/second-largest-digit-in-a-string/description/

Posted in Без рубрики | Comments Off on Algo.Java.PowerOfTreeSet

Algo.Java.ShiftArrayToTheRight2

another example with shifting of array

Posted in Без рубрики | Comments Off on Algo.Java.ShiftArrayToTheRight2

Java.Algo.RotateMatrix.90.Clockwise

/** * https://leetcode.com/problems/determine-whether-matrix-can-be-obtained-by-rotation/description/ */ to rotate matrix 90 degrees clockwise we have to transpose and flip it Example

Posted in Без рубрики | Comments Off on Java.Algo.RotateMatrix.90.Clockwise