LeetCode --- 2085. Count Common Words With One Occurrence 解题报告

Question:

Given two string arrays words1 and words2, return the number of strings that appear exactly once in each of the two arrays.

Example 1:

Input: words1 = ["leetcode","is","amazing","as","is"], words2 = ["amazing","leetcode","is"]
Output: 2
Explanation:
- "leetcode" appears exactly once in each of the two arrays. We count this string.
- "amazing" appears exactly once in each of the two arrays. We count this string.
- "is" appears in each of the two arrays, but there are 2 occurrences of it in words1. We do not count this string.
- "as" appears once in words1, but does not appear in words2. We do not count this string.
Thus, there are 2 strings that appear exactly once in each of the two arrays.
<

相关推荐

  1. LeetCode --- 2103. Rings and Rods 解题报告

    2024-07-10 14:28:02       17 阅读
  2. LeetCode --- 2129. Capitalize the Title 解题报告

    2024-07-10 14:28:02       18 阅读
  3. LeetCode --- 2000. Reverse Prefix of Word 解题报告

    2024-07-10 14:28:02       61 阅读
  4. LeetCode --- 2032. Two Out of Three 解题报告

    2024-07-10 14:28:02       44 阅读
  5. LeetCode --- 2057. Smallest Index With Equal Value 解题报告

    2024-07-10 14:28:02       35 阅读
  6. LeetCode --- 2073. Time Needed to Buy Tickets 解题报告

    2024-07-10 14:28:02       22 阅读
  7. LeetCode --- 2119. A Number After a Double Reversal 解题报告

    2024-07-10 14:28:02       18 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-10 14:28:02       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-10 14:28:02       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-10 14:28:02       57 阅读
  4. Python语言-面向对象

    2024-07-10 14:28:02       68 阅读

热门阅读

  1. Transformer模型论文解读、源码分析和项目实践

    2024-07-10 14:28:02       20 阅读
  2. python:使用openpyxl模块处理excel

    2024-07-10 14:28:02       18 阅读
  3. pg数据库时间比较

    2024-07-10 14:28:02       22 阅读
  4. C# 枚举的定义及使用

    2024-07-10 14:28:02       26 阅读
  5. Prompt Engineering 探险

    2024-07-10 14:28:02       23 阅读
  6. 机器学习之神经网络

    2024-07-10 14:28:02       28 阅读
  7. Lianwei 安全周报|2024.07.09

    2024-07-10 14:28:02       20 阅读