about | help | code help+videos | done | prefs |
This problem MAY be done recursively, but recursion is NOT required! Write a method that returns an array containing two integers in the form [row, column] where 'row' and 'column' are the row number and column number of the FIRST occurrence of the 'target' number in Pascal's Triangle. Remember that the top row in Pascal's Triangle is row zero and that the first number in each row is column zero. When searching for the FIRST occurrence, search from the top down and then left to right. So a lower row number takes precedence over a lower column number. Look at the test data for examples. may25_2018_SL_FindPascalFirstProduct(1) → [0, 0] may25_2018_SL_FindPascalFirstProduct(77520) → [20, 7] may25_2018_SL_FindPascalFirstProduct(23751) → [29, 4] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 480
Copyright Nick Parlante 2017 - privacy