38724 time complexity: 334722