当前位置:网站首页>[punch in] flip the string (simple)
[punch in] flip the string (simple)
2022-07-02 03:27:00 【dataloading】
describe
Write a method , Accepts the given string as input , Returns a new string after flipping this string character by character .
Examples 1:
Input :"hello"
Output :"olleh"
Examples 2:
Input :"hello world"
Output :"dlrow olleh"
class Solution:
""" @param s: a string @return: return a string """
def reverseString(self, s):
# write your code here
l = len(s)
ans = ''
for i in range(l-1,-1,-1):
ans += s[i]
return ans
边栏推荐
猜你喜欢

SAML2.0 notes (I)

MySQL connection query and subquery

Verilog state machine

C shallow copy and deep copy

In the era of programmers' introspection, five-year-old programmers are afraid to go out for interviews

JIT deep analysis

C reflection practice
On redis (II) -- cluster version

《MATLAB 神經網絡43個案例分析》:第42章 並行運算與神經網絡——基於CPU/GPU的並行神經網絡運算

跟着CTF-wiki学pwn——ret2shellcode
随机推荐
C#联合halcon脱离halcon环境以及各种报错解决经历
GSE104154_scRNA-seq_fibrotic MC_bleomycin/normalized AM3
Calculation of page table size of level 2, level 3 and level 4 in protection mode (4k=4*2^10)
JS generate random numbers
[C Advanced] brother Peng takes you to play with strings and memory functions
Qualcomm platform wifi-- WPA_ supplicant issue
《MATLAB 神經網絡43個案例分析》:第42章 並行運算與神經網絡——基於CPU/GPU的並行神經網絡運算
Gradle 笔记
在QML中加载不同字体
JIT deep analysis
Global and Chinese markets for infant care equipment, 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese market of handheld ultrasonic scanners 2022-2028: Research Report on technology, participants, trends, market size and share
Grpc快速实践
Exchange rate query interface
Form custom verification rules
[HCIA continuous update] overview of dynamic routing protocol
venn图取交集
2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
Mathematical calculation in real mode addressing