Count Triplets

  • + 1 comment

    It was genius to iterate inputs in reverse order, so checking the next sequence can be done by multiplication, which lets the algorithm not need to check if the next sequence is still integer from dividing an input with r. And I was using one map with int[count, countOfNextSequence] as value, but it seems using two maps are clearer than my approach. And I can't believe this is a medium level problem XD lol I'm dying.