We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Its very nice and easy implimentation, but I would consider little modification to your code such as
1.There is no need to check (m==10) and (m==40) as they both will be considered in (m<30) and (m>30) respectively.
2.No need to maintain two arrays for storing hours and minutes separately as the elements of hours will be part of the minutes array, so just accessing the same array elements with different index can optimize your code.
The Time in Words
You are viewing a single comment's thread. Return to all comments →
Its very nice and easy implimentation, but I would consider little modification to your code such as
1.There is no need to check (m==10) and (m==40) as they both will be considered in (m<30) and (m>30) respectively.
2.No need to maintain two arrays for storing hours and minutes separately as the elements of hours will be part of the minutes array, so just accessing the same array elements with different index can optimize your code.