Skip to content
Vincent Oliveira edited this page Sep 6, 2016 · 1 revision

Tiller Test Dev Backend - Test #5

What should I do ?

Write a function that given a list of non negative integers, arranges them such that they form the largest possible number.

For example, given [50, 2, 1, 9] the largest formed number is 95021.

Where should I write my code ?

    //src/AppBundle/Controller/Test5Controller
    
    public function test5Action(Request $request)
    {
        $list = $request->request->get('list');

        $result = null;
        
        return new JsonResponse($result, JsonResponse::HTTP_OK);
    }

How can I test my code ?

$ curl -H "Content-Type: application/json" -X POST -d '{'list':[50, 2, 1, 9]}' test.local/test5
95021

Clone this wiki locally