All Posts

Leetcode 2761: Prime Pairs With Target Sum

You are given an integer ’n’. Your task is to find all pairs of prime numbers [x, y] such that 1 <= x <= y <= n, x + y = n, and both x and y are prime numbers. Return a 2D sorted list of such prime pairs. If no such pairs exist, return an empty array.

Leetcode 2769: Find the Maximum Achievable Number

Given two integers num and t, determine the maximum achievable number after performing at most t operations, where each operation allows simultaneous increments or decrements of num and the target number by 1.

Leetcode 2806: Account Balance After Rounded Purchase

You have a bank account with a balance of 100 dollars. You are given a purchase amount and need to round it to the nearest multiple of 10. Then, deduct the rounded amount from your account balance and return the remaining balance.

Leetcode 2807: Insert Greatest Common Divisors in Linked List

You are given the head of a linked list, where each node contains an integer. For each pair of adjacent nodes, insert a new node with a value equal to the greatest common divisor (GCD) of the two nodes. Return the modified linked list after performing this operation.

Leetcode 2816: Double a Number Represented as a Linked List

You are given the head of a non-empty linked list representing a non-negative integer, where each node contains a single digit of the number. Your task is to double the integer represented by the linked list and return the resulting number as a new linked list.

Leetcode 2829: Determine the Minimum Sum of a k-avoiding Array

Given two integers, n and k, construct a k-avoiding array of length n. A k-avoiding array is an array of distinct positive integers where no two elements sum up to k. Return the minimum possible sum of such an array.