波浪形的…额,转换? 简单题。

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)

And then read line by line: "PAHNAPLSIIGYIR"

Write the code that will take a string and make this conversion given a number of rows:

convert("PAYPALISHIRING", 3) should return "PAHNAPLSIIGYIR".

 

题目不难…

也不多说啥,也没坑点,自己注意越界就好。

 

每天Python一题呗…

 

【LeetCode】6. ZigZag Conversion
Tagged on:     
0 0 投票数
Article Rating
订阅评论
提醒

0 评论
最新
最旧 最多投票
内联反馈
查看所有评论