Ad
  • Default User Avatar

    But if the sum is a perfect square itself doesnt that makes finding two factor for it redundant.
    and also in sample test setter himself has given us an example in which one factor is 0.

  • Custom User Avatar

    The tests fail when one of returned numbers is 0, while description says the answer needs to be non-negative.

    As a temporary workaround you can try to return such pair, where none of the numbers is 0. For example, tests fail for:

    Input: [3, 2, 5, 5, 4, 2, 6, 6, 9, 3, 3, 2, 3, 7, 2, 3, 4, 9, 6, 7, 3, 8, 8, 7, 6, 3, 6, 6, 4, 4, 5, 3, 9, 8, 3, 9, 2, 2, 6, 6]
    Output: [38575890503412110, 0]
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I used pointers for the high and low values(0.1ms), ive tried to use sets and compliments aswell(10s). Kinda running low on ideas but im thinking circle equations have something to do with it. Am i right?

  • Default User Avatar

    Don't try to solve in a brute-force approach.
    Try thinking in mathematics perspective

  • Default User Avatar

    my code runs in O(n) times. I'm confused on what time complexity is expected. If you could solve this, what was the complexity of your code.

  • Default User Avatar

    Good Kata,
    5 and Above Katas need good knowledge on Mathematics, Data Structures and Algorithms.

    Learnt something new from this kata!

  • Default User Avatar

    Yes, there was a small bug.
    Fixed it and all tests passed :)

  • Custom User Avatar

    Your answers seem to be incorrect:

    Expected:
    sqrt(1179090294573338820122431368020571219193838496144981853128507405455819949176596069394854257633924) = 1085859242523329457395988000000000000000000000000
    sqrt(85767278828367782602943401434250693589891146724341410177841229729859128397916522826887698538486) = 292860510872271379029706058286700319780600952712
    
    Actual:
    1085859242523329457395988099999999999999999999999**2 = 1,179,090,294,573,338,820,122,431,585,192,419,723,859,729,975,339,438,281,514,953,341,085,208,023,800,000,000,000,000,000,000,001
    292860510872271379029706058286709999999999999999**2 = 85,767,278,828,367,782,602,943,401,434,256,363,497,888,268,044,527,690,838,818,081,341,940,587,883,426,580,000,000,000,000,001
    
  • Default User Avatar

    Failed scenarios:

    input : 1179090294573338820122431368020571219193838496144981853128507405455819949176596069394854257633924
    my output : 1085859242523329457395988099999999999999999999999

    input : 85767278828367782602943401434250693589891146724341410177841229729859128397916522826887698538486
    my output : 292860510872271379029706058286709999999999999999

    Can you validate whether my outputs are correct ?

  • Default User Avatar

    Java language

    The 7 Basic Tests are passed
    After clicking 'ATTEMPT' the randomTestsNoRemainder and randomTests are failing

  • Custom User Avatar

    What language? What are inputs causing your solution to fail?

  • Default User Avatar

    @hobovsky can you help me

  • Default User Avatar

    My program is giving correct output but the test cases are failing with below error :<

    expected:<858523985810[444263251626]> but was:<858523985810[999999999999]>