log / tags / leetcode

2 posts tagged with "leetcode"

if-else vs switch-case

Reverse vowel positions in a string using two pointers, and determine vowels using if-else or switch-case. Discusses performance differences between the two methods, with switch-case proving faster due to compiler optimization.

08 Jul 2024 2 min read

euclidean algorithm - great common divisor

Understand the use of Euclidean algorithms in finding the greatest common divisor. Includes examples of naive and recursive approaches in Go, and an application in solving a string division problem on LeetCode.

05 Jul 2024 1 min read