So In A Interview I Was Asked That I Have To Divide The Input Array Into Three Parts Such That Taking Difference Of The Maximum And Minimum Value Of Each Part And Then The Final Answer Should Be Minimum Of The Three Differences Obtain From Three Parts And The Three Parts Should Contain At Leat One Element .How To Solve This Question In Minimum Possibel Tiem
So In A Interview I Was Asked That I Have To Divide The Input Array Into Three Parts Such That Taking Difference Of The Maximum And Minimum Value Of Each Part And Then The Final Answer Should Be Minimum Of The Three Differences Obtain From Three Parts And The Three Parts Should Contain At Leat One Element .How To Solve This Question In Minimum Possibel Tiem
Expert Answer
To solve this problem with minimum time and space complexity in C++, you can follow a straightforwar.
OR