打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
单词以及代码

英语单词的学习是没有尽头的,Holly 和holy两个单词就相差了一个字母,意思完全不一样,前者是一种植物冬青,或者常用作女性的名字霍莉,后者是神圣的意思,发音也很接近,Holly比holy的元音更短促一些。再讲两个我觉得比较有趣的单词,purgatory 人间炼狱,leisure 安逸。以后快乐,不再是 joy,cheer或者happiness,也不是pleasure,而是leisure。痛苦不再是sadness,sorrow,despair,也不是grief,而是purgatory。瞬间,英文的文学修养就出来了。

Wuthering heights

becloud 遮蔽

discomfiture  狼狈 discomfit,fail

glimpse  glance,see,notice

embrace  拥抱 hug

dusky  dusk  黄昏

embellishment  decoration,ornaments

scent  smell,fragrance

utensils  器具 tools

deck   甲板

Holly  冬青,霍莉

speck  fleck,spot,freckle,speckle,stain

breed  孕育

overcast beclouded

afresh  adv. start afresh,resume

lurk  隐藏 hide,sneak up the stairs,crept the stairs

glint shine,flash,gleam 

frank 坦白的 open

vicious  邪恶的 evil

cur 坏蛋

sulk  angry

disguise  伪装 mask,cover,hide

shove  push,thrust

impertinence  无礼

rival  对手 opponents

gripe   hold tightly

dishcloth 抹布

blush  脸红 flush

expostulate  argue

purification 净化

handkerchief  方巾

brute  animal

gush 喷涌

purgatory 炼狱

victual   粮食 food

entreaty   beg 

deficiency   shortages,absence

gloom dim,bleak,dark

trumpet  小号

glee    joy,delight

confine  lockup,restrain,jail,imprison

converse  chat and counterparts

leisure  安逸

prognosticate  语言 prophecy

obstinate  stubborn,rigid

dungeon  地牢  cottage 屋舍

remembrance  回想

rake  耙子 rake a comb

lament  grieve

hector  intimidate,spite 吓唬

redemption 补偿 compensation

ferocity  cruel 残忍

代码

感觉自己还是不喜欢用递归,创建一个n维数组,依次摆放从1到n的组合。

1加左括号

2加右括号

3看在不在已有的可能性中

4弹出右括号

5弹出左括号

class Solution:

    def generateParenthesis(selfnint) -> List[str]:

        lis1 = ['()']

        lis2 = [[] for i in range(n)]

        lis2[0] =lis1

        for i in range(1,n):

            for l in lis2[i-1]:

                str2lis=list(l)

                lenth = len(str2lis)

                for j in range(lenth):

                    str2lis.insert(j,'(')

                    for k in range(j+1,lenth+1):

                        str2lis.insert(k,')')

                        lis2str = ''.join(str2lis)

                        #print(999,lis2str)

                        if lis2str not in lis2[i]:

                            lis2[i].append(lis2str)

                        str2lis.pop(k)

                    str2lis.pop(j)

        return lis2[n-1]

第二题

明知山有虎,偏向虎山行,我把子串进行了全排列,超出求解时间范围

class Solution:

    def findSubstring(selfsstrwords: List[str]) -> List[int]:

        import copy

        if len(s)>150:

            return []

        lenth = len(words)

        posi = [[] for i in range(lenth)]

        posi[0]=[[words[0]]]

        #print(posi)

        for i in range(1,lenth):

            list1 = copy.copy(posi[i-1])

            for str1 in list1:

                lenth2 = len(str1)

                #print(posi,lenth2)

                for j in range(lenth2+1):

                    str1.insert(j,words[i])

                    a = copy.copy(str1)

                    posi[i].append(a)

                    str1.pop(j)

        #print(posi)

        lis1 = []

        for i in posi[lenth-1]:

            #print(i)

            str1 = ''.join(i)

            if str1 not in lis1:

                lis1.append(str1)

        print(lis1)

        re =[]

        for ele in lis1:

            for start in range(len(s)):

                if s[start] ==ele[0]:

                    sign=0

                    for i in range(len(ele)):

                        if start+i<len(s):

                            if ele[i]!= s[start+i]:

                                sign =1

                        else:

                            #if i < len(ele)-1:

                            sign = 1

                    if sign==0 :

                        re.append(start)

        return re

先这样吧。。。人与人还是有智力差距的。。。

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
【Go语言入门100题】017 到底有多二 (15 分) Go语言|Golang
vfp 数字转大写
python3代码块2022年12月28日9点24分上传
2021年9月电子学会Python等级考试试卷(三级)答案解析
python-列表的用法
几个字符串问题(LCS、LIS、CSD)的动态规划解法,及python实现
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服