카타 8급 My head is at the wrong end!

1 C[ | ]

#include <stddef.h>
const char **fix_the_meerkat(const char **arr) {
  char* temp = arr[2];
  arr[2] = arr[0];
  arr[0] = temp;
  return arr;
}
#include <stddef.h>
const char **fix_the_meerkat(const char **arr) {
  char* temp = *arr;
  *arr = *(arr+2);
  *(arr+2) = temp;
  return arr;
}

2 PHP[ | ]

function fixTheMeerkat($arr) {
  return array_reverse($arr);
}
use function array_reverse as fixTheMeerkat;
function fixTheMeerkat($arr) {
  return [$arr[2], $arr[1], $arr[0]];
}
function fixTheMeerkat($arr) {
  $temp = $arr[0];
  $arr[0] = $arr[2];
  $arr[2] = $temp;
  return $arr;
}

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}