The TransCompilator

Solved LeetCode program · 553 of 1,000

#0779 · K-th Symbol in Grammar

Medium Math chunk-12.md

Original English source

Keep a shared symbol of 0.

To expand from rows (a whole number) with place (a whole number). If rows is 1, set symbol to 0, return. If place modulo 2 is 1, expand from rows minus 1 with (place plus 1) divided by 2. If place modulo 2 is 0, expand from rows minus 1 with place divided by 2, set symbol to 1 minus symbol.

Expand from 4 with 5. Show symbol.

Open in Playground Browse all 1,000 problems

Expected stdout

1