id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > may25_2018_SL_FindPascalFirstProduct
prev  |  next  |  chance

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)

public int[] may25_2018_SL_FindPascalFirstProduct(int target) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 480

Copyright Nick Parlante 2017 - privacy