Nokia Interview Question

Write Matlab code to solve a simple problem