You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vincent Oliveira edited this page Sep 6, 2016
·
3 revisions
Tiller Test Dev Backend - Test #2
What should I do ?
Write a webservice that combines two lists by alternatingly taking elements. For exemple: given two lists [A, B, C] and [1, 2, 3], the results sould be [A, 1, B, 2, C, 3]
ps: you're on a git, don't forget it ;)
Where should I write my code ?
//src/AppBundle/Controller/Test2Controller
public function test2Action(Request $request)
{
$list1 = $request->request->get('list1');
$list2 = $request->request->get('list2');
$finalList = array();
/**
* @TODO:
* Write a webservice that combines two lists by alternatingly taking
* elements. For exemple: given two lists [A, B, C] and [1, 2, 3], the
* results sould be [A, 1, B, 2, C, 3]
*/
return new JsonResponse($finalList, JsonResponse::HTTP_OK);
}