1680 time complexity: 30227111