热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

LeetCode1540.K次操作转变字符串哈希

地址 https:leetcode-cn.comproblemscan-convert-string-in-k-moves给你两个字符串 s 和 t ,你的目标是在k 次操作以内把

.---------------------------------------------------------------------------.
| |
| Bash History Cheat Sheet |
| |
---------------------------------------------------------------------v1.12-
| Created by Peter Krumins (peter@catonmat.net, @pkrumins on twitter) |
| www.catonmat.net -- good coders code, great coders reuse |
| |
| Released under the GNU Free Document License |
---------------------------------------------------------------------------
===================== Emacs Keyboard Shortcut Summary =====================
.
--------------.------------------------------------------------------------.
| | |
| Shortcut | Description |
| | |
--------------+------------------------------------------------------------
| C-p | Fetch the previous command from the history list. |
--------------+------------------------------------------------------------
| C-n | Fetch the next command from the history list. |
--------------+------------------------------------------------------------
| M-<| Move to the first line in the history. |
--------------+------------------------------------------------------------
| M-> | Move to the end of the input history. |
--------------+------------------------------------------------------------
| C-r | Search backward starting at the current line (incremental) |
--------------+------------------------------------------------------------
| C-s | Search forward starting at the current line (incremental). |
--------------+------------------------------------------------------------
| M-p | Search backward using non-incremental search. |
--------------+------------------------------------------------------------
| M-n | Search forward using non-incremental search |
--------------------------------------------------------------------------

======================= Vi Keyboard Shortcut Summary ======================
.
--------------.------------------------------------------------------------.
| | |
| Shortcut | Description |
| | |
--------------+------------------------------------------------------------
| k | Fetch the previous command from the history list. |
--------------+------------------------------------------------------------
| j | Fetch the next command from the history list. |
--------------+------------------------------------------------------------
| /string or | Search history backward for a command matching string. |
| CTRL-r | |
--------------+------------------------------------------------------------
| ?string or | Search history forward for a command matching string. |
| CTRL-s | (Note that on most machines Ctrl-s STOPS the terminal |
| | output, change it with `stty (Ctrl-q to resume)). |
--------------+------------------------------------------------------------
| n | Repeat search in the same direction as previous. |
--------------+------------------------------------------------------------
| N | Repeat search in the opposite direction as previous. |
--------------+------------------------------------------------------------
| G | Move to history line N (for example, 15G). |
--------------------------------------------------------------------------

======================== History Expansion Summary ========================

Event Designators:
.
--------------.------------------------------------------------------------.
| | |
| Designator | Description |
| | |
--------------+------------------------------------------------------------
| ! | Start a history substitution. |
--------------+------------------------------------------------------------
| !! | Refer to the last command. |
--------------+------------------------------------------------------------
| !n | Refer to the n-th command line (try `history command). |
--------------+------------------------------------------------------------
| !-n | Refer to the current command line minus n. |
--------------+------------------------------------------------------------
| !string | Refer to the most recent command starting with string. |
--------------+------------------------------------------------------------
| !?string? | Refer to the most recent command containing string. |
--------------+------------------------------------------------------------
| ^str1^str2^ | Quick substitution. Repeat the last command, replacing |
| | str1 with str2. |
--------------+------------------------------------------------------------
| !# | Refer to the entire command line typed so far. |
--------------------------------------------------------------------------

Word Designators:
(Word designators follow the event designators, separated by a collon
:)
.
--------------.------------------------------------------------------------.
| | |
| Designator | Description |
| | |
--------------+------------------------------------------------------------
| 0 | The zeroth (first) word in a line (usually command name). |
--------------+------------------------------------------------------------
| n | The n-th word in a line. |
--------------+------------------------------------------------------------
| ^ | The first argument (the second word) in a line. |
--------------+------------------------------------------------------------
| $ | The last argument in a line. |
--------------+------------------------------------------------------------
| % | The word matched by the most recent string search. |
--------------+------------------------------------------------------------
| x-y | A range of words from x to y (-y is synonymous with 0-y). |
--------------+------------------------------------------------------------
| * | All words but the zeroth (synonymous with 1-$). |
--------------+------------------------------------------------------------
| x* | Synonymous with x-$ |
--------------+------------------------------------------------------------
| x- | The words from x to the second to last word. |
--------------------------------------------------------------------------

Modifiers (modifiers follow word designators, separated by a colon):
.
--------------.------------------------------------------------------------.
| | |
| Modifier | Description |
| | |
--------------+------------------------------------------------------------
| h | Remove a trailing pathname component, leaving the head. |
--------------+------------------------------------------------------------
| t | Remove all leading pathname component, leaving the tail. |
--------------+------------------------------------------------------------
| r | Remove a trailing suffix of the form .xxx, leaving the |
| | basename. |
--------------+------------------------------------------------------------
| e | Remove all but the trailing suffix. |
--------------+------------------------------------------------------------
| p | Print the resulting command but do not execute it. |
--------------+------------------------------------------------------------
| q | Quotes the substituted words, escaping further |
| | substitutions. |
--------------+------------------------------------------------------------
| x | Quotes the substituted words, breaking them into words at |
| | blanks and newlines. |
--------------+------------------------------------------------------------
| s/old/new/ | Substitutes new for old. |
--------------+------------------------------------------------------------
| & | Repeats the previous substitution. |
--------------+------------------------------------------------------------
| g | Causes s/old/new/ or & to be applied over the entire |
| | event line. |
--------------------------------------------------------------------------

============ History Behavior Modification via Shell Variables ============
.
----------------.----------------------------------------------------------.
| | |
| Shell Variable | Description |
| | |
----------------+----------------------------------------------------------
| HISTFILE | Controls where the history file gets saved. |
| | Set to /dev/null not to save the history. |
| | Default: ~/.bash_history |
----------------+----------------------------------------------------------
| HISTFILESIZE | Controls how many history commands to keep in HISTFILE |
| | Default: 500 |
----------------+----------------------------------------------------------
| HISTSIZE | Controls how many history commands to keep in the |
| | history list of current session. |
| | Default: 500 |
----------------+----------------------------------------------------------
| HISTIGNORE | Controls which commands to ignore and not save to the |
| | history list. The variable takes a list of |
| | colon separated values. Pattern & matches the previous |
| | history command. |
--------------------------------------------------------------------------

============ History Behavior Modification via `shopt Command ============

.
----------------.----------------------------------------------------------.
| | |
| shopt Option | Description |
| | |
----------------+----------------------------------------------------------
| histappend | Setting the variable appends current session history to |
| | HISTFILE. Unsetting overwrites the file each time. |
----------------+----------------------------------------------------------
| histreedit | If set, puts a failed history substitution back on the |
| | command line for re-editing. |
----------------+----------------------------------------------------------
| histverify | If set, puts the command to be executed after a |
| | substitution on command line as if you had typed it. |
--------------------------------------------------------------------------

shopt options can be set by a `shopt
-s option and
can be unset by a `shopt -u option.
=============================== Examples ==================================
$
echo a b c d e (executes `echo ab c d e`)
a b c d e
$
echo !!:3-$ (executes `echo c d e`)
c d e
$
echo !-2:*:q (executes `echo a b c d e`)
a b c d e
$
echo !-3:1:2:4:x (executes `echo a b d`)
a b d
$
echo !-4:1-3:s/a/foo/:s/b/bar/:s/c/baz/ (executes `echo foo bar baz`)
foo bar baz
$
tar -xzf package-x.y.z.tgz
...
$ cd
!-1:$:r (executes `cd package-x.y.z`)
package
-x.y.z $

$
ls -a /tmp
file1 file2 file3 ...
$
^-a^-l^ (executes `ls -l /tmp`)
-rw------- 1 user user file1
...
===========================================================================
.
---------------------------------------------------------------------------.
| Created by Peter Krumins (peter@catonmat.net, @pkrumins on twitter) |
| www.catonmat.net -- good coders code, great coders reuse |
---------------------------------------------------------------------------

 

LeetCode 1540. K 次操作转变字符串 哈希



推荐阅读
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • QUIC协议:快速UDP互联网连接
    QUIC(Quick UDP Internet Connections)是谷歌开发的一种旨在提高网络性能和安全性的传输层协议。它基于UDP,并结合了TLS级别的安全性,提供了更高效、更可靠的互联网通信方式。 ... [详细]
  • 深入理解OAuth认证机制
    本文介绍了OAuth认证协议的核心概念及其工作原理。OAuth是一种开放标准,旨在为第三方应用提供安全的用户资源访问授权,同时确保用户的账户信息(如用户名和密码)不会暴露给第三方。 ... [详细]
  • 2023 ARM嵌入式系统全国技术巡讲旨在分享ARM公司在半导体知识产权(IP)领域的最新进展。作为全球领先的IP提供商,ARM在嵌入式处理器市场占据主导地位,其产品广泛应用于90%以上的嵌入式设备中。此次巡讲将邀请来自ARM、飞思卡尔以及华清远见教育集团的行业专家,共同探讨当前嵌入式系统的前沿技术和应用。 ... [详细]
  • CSS 布局:液态三栏混合宽度布局
    本文介绍了如何使用 CSS 实现液态的三栏布局,其中各栏具有不同的宽度设置。通过调整容器和内容区域的属性,可以实现灵活且响应式的网页设计。 ... [详细]
  • 在Linux系统中配置并启动ActiveMQ
    本文详细介绍了如何在Linux环境中安装和配置ActiveMQ,包括端口开放及防火墙设置。通过本文,您可以掌握完整的ActiveMQ部署流程,确保其在网络环境中正常运行。 ... [详细]
  • 本文总结了2018年的关键成就,包括职业变动、购车、考取驾照等重要事件,并分享了读书、工作、家庭和朋友方面的感悟。同时,展望2019年,制定了健康、软实力提升和技术学习的具体目标。 ... [详细]
  • 在计算机技术的学习道路上,51CTO学院以其专业性和专注度给我留下了深刻印象。从2012年接触计算机到2014年开始系统学习网络技术和安全领域,51CTO学院始终是我信赖的学习平台。 ... [详细]
  • Linux 系统启动故障排除指南:MBR 和 GRUB 问题
    本文详细介绍了 Linux 系统启动过程中常见的 MBR 扇区和 GRUB 引导程序故障及其解决方案,涵盖从备份、模拟故障到恢复的具体步骤。 ... [详细]
  • 本文介绍了如何使用jQuery根据元素的类型(如复选框)和标签名(如段落)来获取DOM对象。这有助于更高效地操作网页中的特定元素。 ... [详细]
  • 导航栏样式练习:项目实例解析
    本文详细介绍了如何创建一个具有动态效果的导航栏,包括HTML、CSS和JavaScript代码的实现,并附有详细的说明和效果图。 ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 深入理解Cookie与Session会话管理
    本文详细介绍了如何通过HTTP响应和请求处理浏览器的Cookie信息,以及如何创建、设置和管理Cookie。同时探讨了会话跟踪技术中的Session机制,解释其原理及应用场景。 ... [详细]
  • 本文介绍如何在 Xcode 中使用快捷键和菜单命令对多行代码进行缩进,包括右缩进和左缩进的具体操作方法。 ... [详细]
  • 前言--页数多了以后需要指定到某一页(只做了功能,样式没有细调)html ... [详细]
author-avatar
mobiledu2502887107
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有