LeetCode

[Solved] Count Asterisks LeetCode Contest Problem

[Solved] Count Asterisks LeetCode Contest Problem

Count Asterisks: You are given a string s, where every two consecutive vertical bars ‘|’ are grouped into a pair. In other words, the 1st and 2nd ‘|’ make a pair, the 3rd and 4th ‘|’ make a pair, and so forth. Return the number of ‘*’ in s, excluding the ‘*’ between each pair of ‘|’. Note that each ‘|’ will belong to exactly one…

[Solved] Maximum XOR After Operations LeetCode Contest Problem

[Solved] Maximum XOR After Operations LeetCode Contest Problem

Maximum XOR After Operations: You are given a 0-indexed integer array nums. In one operation, select any non-negative integer x and an index i, then update nums[i] to be equal to nums[i] AND (nums[i] XOR x). Note that AND is the bitwise AND operation and XOR is the bitwise XOR operation. Return the maximum possible bitwise XOR of all…

[Solved] Selling Pieces of Wood Contest Problem

[Solved] Selling Pieces of Wood Contest Problem

Selling Pieces of Wood: You are given two integers m and n that represent the height and width of a rectangular piece of wood. You are also given a 2D integer array prices, where prices[i] = [hi, wi, pricei] indicates you can sell a rectangular piece of…