Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ulises-jeremias/v-daily-coding-problems

V solutions to problems sent by dailycodingproblem.com
https://github.com/ulises-jeremias/v-daily-coding-problems

Last synced: 20 days ago
JSON representation

V solutions to problems sent by dailycodingproblem.com

Awesome Lists containing this project

README

        

# V Daily Coding Problems

V solutions to problems sent by dailycodingproblem.com

## Problem 1

This problem was asked by Apple.

Implement the function fib(n), which returns the nth number in the Fibonacci
sequence, using only O(1) space.

[Solution](./solutions/problem_001.v)

## Problem 2

This problem was asked by Facebook.

Given an array of numbers of length N, find both the minimum and maximum using
less than 2 * (N - 2) comparisons.

[Solution](./solutions/problem_002.v)

## Problem 3

This problem was asked by Nvidia.

You are given a list of N points (x1, y1), (x2, y2), ..., (xN, yN) representing
a polygon. You can assume these points are given in order; that is, you can
construct the polygon by connecting point 1 to point 2, point 2 to point 3, and
so on, finally looping around to connect point N to point 1.

Determine if a new point p lies inside this polygon. (If p is on the boundary of
the polygon, you should return False).

[Solution](./solutions/problem_003.v)

## Problem 4

This problem was asked by Amazon.

A tree is symmetric if its data and shape remain unchanged when it is reflected about the root node. The following tree is an example:
Given a k-ary tree, determine whether it is symmetric.

[Solution](./solutions/problem_004.v)