• 请不要在回答技术问题时复制粘贴 AI 生成的内容
csfreshman
V2EX  ›  程序员

寻题启示,没有重谢

  •  
  •   csfreshman · Apr 24, 2021 · 1778 views
    This topic created in 1867 days ago, the information mentioned may be changed or developed.

    看某公司面经,虽然知道了大概解法,但是想在 leetcode 上实战以下(帖子里说是原题,没搜到关键字) 题目大概描述: 给定一个数组 {3,2,1,4,5,6,7,8,9,11,10},判断是否存在元素,他的值比前面的元素都小(大),比后面的元素都大(小),时间和空间复杂度不能超过 O(n)

    虽然知道了解法(两个 arry,一个从左到右计算,一个从右到左计算,然后判断是否符合),但是想自己写一下验证下,求助各位大佬有没有知道题号的,感激不尽。

    3 replies    2021-04-24 10:23:58 +08:00
    iBugOne
        1
    iBugOne  
       Apr 24, 2021
    csfreshman
        2
    csfreshman  
    OP
       Apr 24, 2021
    @iBugOne 还不太一样,比这道简单,我顺手把这道写下,感谢老铁。
    Vegetable
        3
    Vegetable  
       Apr 24, 2021
    顺手做了一下,有意思,这是第一道题我凭感觉写的代码过了,但是自己并没有想的很清楚逻辑...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1197 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 23:29 · PVG 07:29 · LAX 16:29 · JFK 19:29
    ♥ Do have faith in what you're doing.