Google

Longest Absolute Path in File System Representation

Find the length of the longest absolute path to a file within the abstracted file system. The length is measured…

4 days ago

Estimate π Using Monte Carlo Method

The formula for the area of a circle is given by πr². Use the Monte Carlo method to approximate the…

1 month ago

Count Unival Subtrees in a Binary Tree

A unival tree (short for "universal value tree") is a tree in which all nodes have the same value. Given…

2 months ago

Implement an XOR Linked List

An XOR-linked list is a memory-efficient version of a doubly linked list. Instead of each node storing separate next and…

2 months ago

Serialize and Deserialize a Binary Tree

Given the root of a binary tree, create two functions: serialize(root) - Converts the binary tree into a string representation.…

2 months ago