面试程序题
一、写一个函数 传入一个数组和N 要求把前N个元素移到最后 需要占用最少内存
比如传入[a b c d e], N=2, 要求返回数组[c d e a b]
二、in case you are not familiar with regular expression substitution, here's a quick tutorial:
the syntax of string substitution is:
VARIABLE =~ s/SEARCH_PATTERN/NEW_STRING/
For example,
$a = 'abc,123';
$a =~ s/(\w+),(\w+)/\2,\1/; # $a is now '123,abc' because \1='abc' and \2='123'
Here's the question:
write ONE substitution statement(ie. s/SEARCH_PATTERN/NEW_STRING/) so that
"<date>1999-02-25</date>" will be updated to "<date>02-25-1999</date>" AND
"<date>2005-11-03</date>" will be updated to "<date>11-03-2005</date>"
比如传入[a b c d e], N=2, 要求返回数组[c d e a b]
二、in case you are not familiar with regular expression substitution, here's a quick tutorial:
the syntax of string substitution is:
VARIABLE =~ s/SEARCH_PATTERN/NEW_STRING/
For example,
$a = 'abc,123';
$a =~ s/(\w+),(\w+)/\2,\1/; # $a is now '123,abc' because \1='abc' and \2='123'
Here's the question:
write ONE substitution statement(ie. s/SEARCH_PATTERN/NEW_STRING/) so that
"<date>1999-02-25</date>" will be updated to "<date>02-25-1999</date>" AND
"<date>2005-11-03</date>" will be updated to "<date>11-03-2005</date>"
...全文
相关推荐
程序员面试逻辑题
根据提供的文件信息,本文将围绕“程序员面试逻辑题”这一主题进行深入探讨,解析与程序员面试相关的逻辑题目及其重要性,帮助求职者更好地准备面试。
程序员面试逻辑题集合.docx
程序员作为技术领域的专业人才,在求职时面临的面试竞争尤为激烈。各大公司为了选拔出最优秀的人才,往往会通过逻辑题来考察应聘者的综合素质。
程序员面试100题(何海涛)
何海涛所编写的“程序员面试100题”不仅提供了一个学习与复习的平台,而且前60题就专注于数组、链表和二叉树这三个核心数据结构的学习与应用。
程序员面试笔试机试100题系列
微软面试100题系列是程序员求职过程中非常重要的参考资料,这套题集对于准备参加微软、谷歌、百度等大型科技公司面试的应聘者来说尤为关键。
Java程序员面试经:面试前到底该不该刷题以及面试前该如何准备.pdf,这是一份不错的文件
在Java程序员的面试准备过程中,一个争议性的话题是刷题的必要性。本文将深入探讨Java程序员面试前是否应该刷题,以及应该如何准备才能更好地展示自己。


