当前位置:网站首页>[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
边栏推荐
猜你喜欢

Large screen visualization from bronze to the advanced king, you only need a "component reuse"!

This article describes the step-by-step process of starting the NFT platform project

Knowing things by learning | self supervised learning helps improve the effect of content risk control

Eight steps of agile development process

Form custom verification rules

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

Docker installs canal and MySQL for simple testing and implementation of redis and MySQL cache consistency

《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算

MySQL connection query and subquery

Discrimination between sap Hana, s/4hana and SAP BTP
随机推荐
/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW/GSM5598265_matrix_inflection_demult
C # joint halcon out of halcon Environment and various Error Reporting and Resolution Experiences
KL divergence is a valuable article
ORA-01547、ORA-01194、ORA-01110
Kotlin basic learning 15
Verilog avoid latch
Calculation of page table size of level 2, level 3 and level 4 in protection mode (4k=4*2^10)
GSE104154_ scRNA-seq_ fibrotic MC_ bleomycin/normalized AM3
[JS reverse series] analysis of a customs publicity platform
Apple added the first iPad with lightning interface to the list of retro products
Kotlin basic learning 17
PMP personal sprint preparation experience
"Analysis of 43 cases of MATLAB neural network": Chapter 41 implementation of customized neural network -- personalized modeling and Simulation of neural network
[C Advanced] brother Peng takes you to play with strings and memory functions
Design details of SAP e-commerce cloud footernavigationcomponent
Kotlin 基础学习13
IPhone 6 plus is listed in Apple's "retro products" list
aaaaaaaaaaaaa
Screenshot literacy tool download and use
C shallow copy and deep copy